﻿@using Web.Infrastructure.JSExtensions
@model object

@functions
{
    IDictionary<string, object> GenerateHtmlAttributes(ModelMetadata metadata)
    {
        Dictionary<string, object> retVal = new Dictionary<string, object>();
      
        List<string> classes = new List<string>();
        if (metadata.AdditionalValues.ContainsKey("expandable"))
            classes.Add("expandable");

        if (classes.Any())
            retVal.Add("class", string.Join(" ", classes));

        if (metadata.AdditionalValues.ContainsKey("autofocus"))
            retVal.Add("autofocus", null);

        return retVal;
    }
}
@Html.JsTextArea("", GenerateHtmlAttributes(ViewData.ModelMetadata))